; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt -passes=instcombine -S %s | FileCheck %s

define i8 @foo(<vscale x 1 x i8> %x, i64 %idx) {
; CHECK-LABEL: @foo(
; CHECK-NEXT:    [[A:%.*]] = alloca <vscale x 1 x i8>, align 1
; CHECK-NEXT:    store <vscale x 1 x i8> [[X:%.*]], ptr [[A]], align 1
; CHECK-NEXT:    [[B:%.*]] = getelementptr i8, ptr [[A]], i64 [[IDX:%.*]]
; CHECK-NEXT:    [[C:%.*]] = load i8, ptr [[B]], align 1
; CHECK-NEXT:    ret i8 [[C]]
;
  %a = alloca <vscale x 1 x i8>
  store <vscale x 1 x i8> %x, ptr %a
  %b = getelementptr i8, ptr %a, i64 %idx
  %c = load i8, ptr %b
  ret i8 %c
}
